﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BF.Common
{
    /// <summary>
    /// 通用数据访问对象封装类
    /// </summary>
    public class PubDataBaseAccess
    {
        /// <summary>
        /// 获取用于操作ADO.NET对象的Microsoft.Practices.EnterpriseLibrary.Data.Database
        /// </summary>
        /// <returns>返回用于操作MemberShip对象的Microsoft.Practices.EnterpriseLibrary.Data.Database(ADO.NET对象)</returns>
        public static Microsoft.Practices.EnterpriseLibrary.Data.Database MemberShipAdoDataBase
        {
            get { return Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(); }
        }

        /// <summary>
        /// 获取用于操作ADO.NET对象的Microsoft.Practices.EnterpriseLibrary.Data.Database
        /// </summary>
        /// <returns>返回用于操作ADO.NET对象的Microsoft.Practices.EnterpriseLibrary.Data.Database</returns>
        public static Microsoft.Practices.EnterpriseLibrary.Data.Database AdoDataBase
        {
            get { return Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase("LocalSqlServer"); }
        }

        /// <summary>
        /// 获取用于操作ADO.NET对象的Microsoft.Practices.EnterpriseLibrary.Data.Database
        /// </summary>
        /// <returns>返回用于操作ADO.NET对象的Microsoft.Practices.EnterpriseLibrary.Data.Database</returns>
        public static Microsoft.Practices.EnterpriseLibrary.Data.Database GetAdoDataBaseByName(string name)
        {
            return Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(name); 
        }

        ///// <summary>
        ///// 获取用于操作System.Data.Objects.ObjectContext对象的BF.Model.hzhdatabaseEntities
        ///// </summary>
        //public static BF.Model.RevolutionaryMartyrEntities EntityDataBase
        //{
        //    get { return new BF.Model.RevolutionaryMartyrEntities(); }
        //}
    }
}
